let arr = [10, 22, 33, 22, 10, 33, 8];
//第一种 用indexof
let newArr = [];
for (let i = 0; i < arr.length; i++) {
  if (newArr.indexOf(arr[i]) === -1) {
    newArr.push(arr[i]);
  }
}
console.log(newArr);

//第二种
let set = new Set(arr);
console.log(Array.from(set));
